import { getData, postData, deleteData, putData } from './axios'
/**
 * 文章相关的api
 */
// ? 获取文章详细信息的Api
export async function findArticleApi(id: any) {
  var res = await getData('/article/find', { id })
  return res
}
// ? 添加单个文章的Api
export async function addArticleApi(data: any) {
  var res = await postData('/article/add', data)
  return res
}
// ? 修改单个文章信息的Api
export async function updateArticleApi(data: any) {
  var res = await putData('/article/update', data)
  return res
}

// ? 获取文章列表的Api
export async function getArticleListApi(params?: any) {
  var res = await getData('/article/list', { ...params })
  return res
}
// ? 删除单个文章的Api
export async function deleteArticleApi(id: string) {
  var res = await deleteData('/article/delete', { id })
  return res
}
/**
 * 文章分类相关的api
 *
 */
// ? 获取文章详细信息的Api
export async function findArticleTypeApi(id: any) {
  var res = await getData('/article/type/find', { id })
  return res
}
// ? 添加单个文章分类的Api
export async function addArticleTypeApi(data: any) {
  var res = await postData('/article/type/add', data)
  return res
}
// ? 修改单个文章分类信息的Api
export async function updateArticleTypeApi(data: any) {
  var res = await putData('/article/type/update', data)
  return res
}
// ? 获取文章分类列表的Api
export async function getArticleTypeListApi(params?: any) {
  var res = await getData('/article/type/list', { ...params })
  return res
}
// ? 删除单个文章分类的Api
export async function deleteArticleTypeApi(id: string) {
  var res = await deleteData('/article/type/delete', { id })
  return res
}
/**
 * 文章标签相关的api
 *
 */
// ? 获取文章详细信息的Api
export async function findArticleLabelApi(id: any) {
  var res = await getData('/article/label/find', { id })
  return res
}
// ? 添加单个文章分类的Api
export async function addArticleLabelApi(data: any) {
  var res = await postData('/article/label/add', data)
  return res
}
// ? 修改单个文章分类信息的Api
export async function updateArticleLabelApi(data: any) {
  var res = await putData('/article/label/update', data)
  return res
}
// ? 获取文章分类列表的Api
export async function getArticleLabelListApi(params?: any) {
  var res = await getData('/article/label/list', { ...params })
  return res
}
// ? 删除单个文章分类的Api
export async function deleteArticleLabelApi(id: string) {
  var res = await deleteData('/article/label/delete', { id })
  return res
}
